

#pragma once


#include "ddatar.h"

namespace tools{

struct FormRoot: FormConfig
{
    virtual ~FormRoot(){}



    template<class W> W& Open(const Str& name)
    {
        mData->mForms.emplace_back( ::std::make_shared<W>(name, this) );
        return *static_cast<W*>(mData->mForms.back().get());
    }

    Form& Open(const Str& name);

private:
    FormRoot(const Str& name);

    PFormRootData mData;
};

}//namespace tools

